
package com.shop.cloud.mall.common.entity;

import cn.hutool.json.JSONArray;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.shop.cloud.common.core.mybatis.typehandler.JsonArrayTypeHandler;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.NotNull;
import java.time.LocalDateTime;

import io.swagger.v3.oas.annotations.media.Schema;
import org.apache.ibatis.type.JdbcType;

/**
 * 商品推荐
 *
 * @author
 * @date 2023-10-16 10:25:37
 */
@Data
@TableName("goods_recommend")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "商品推荐")
public class GoodsRecommend extends Model<GoodsRecommend> {
    private static final long serialVersionUID=1L;

    /**
     * PK
     */
    @TableId(type = IdType.ASSIGN_ID)
    @NotNull(message = "PK不能为空")
    @Schema(description = "PK")
    private String id;
    /**
     * 所属租户
     */
    @NotNull(message = "所属租户不能为空")
    @Schema(description = "所属租户")
    private String tenantId;
    /**
     * 店铺Id
     */
    @NotNull(message = "店铺Id不能为空")
    @Schema(description = "店铺Id")
    private String shopId;
    /**
     * 创建时间
     */
    @NotNull(message = "创建时间不能为空")
    @Schema(description = "创建时间")
    private LocalDateTime createTime;
    /**
     * 最后更新时间
     */
    @NotNull(message = "最后更新时间不能为空")
    @Schema(description = "最后更新时间")
    private LocalDateTime updateTime;
    /**
     * 逻辑删除标记（0：显示；1：隐藏）
     */
    @NotNull(message = "逻辑删除标记（0：显示；1：隐藏）不能为空")
    @Schema(description = "逻辑删除标记（0：显示；1：隐藏）")
    private String delFlag;
    /**
     * 商品Id
     */
    @NotNull(message = "商品Id不能为空")
    @Schema(description = "商品Id")
    private String spuId;
    /**
     * 推荐商品Ids
     */
    @NotNull(message = "推荐商品Ids不能为空")
    @Schema(description = "推荐商品Ids")
    @TableField(typeHandler = JsonArrayTypeHandler.class, jdbcType= JdbcType.VARCHAR)
    private JSONArray spuIds;

}
